package br.hm.telephoneoperator;

/**
 * @author  Helmut
 */
public class Phone {
	/**
	 * @uml.property  name="country"
	 */
	private String country;
	/**
	 * @uml.property  name="dDD"
	 */
	private String DDD;
	/**
	 * @uml.property  name="number"
	 */
	private String number;

	/**
	 * @return
	 * @uml.property  name="country"
	 */
	public String getCountry() {
		return this.country;
	}

	/**
	 * @param country
	 * @uml.property  name="country"
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * @return
	 * @uml.property  name="dDD"
	 */
	public String getDDD() {
		return this.DDD;
	}

	/**
	 * @param DDD
	 * @uml.property  name="dDD"
	 */
	public void setDDD(String DDD) {
		this.DDD = DDD;
	}

	/**
	 * @return
	 * @uml.property  name="number"
	 */
	public String getNumber() {
		return this.number;
	}

	/**
	 * @param number
	 * @uml.property  name="number"
	 */
	public void setNumber(String number) {
		this.number = number;
	}

	@Override
	public String toString() {
		
		return "("+DDD+")" + number;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((DDD == null) ? 0 : DDD.hashCode());
		result = prime * result + ((country == null) ? 0 : country.hashCode());
		result = prime * result + ((number == null) ? 0 : number.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Phone other = (Phone) obj;
		if (DDD == null) {
			if (other.DDD != null)
				return false;
		} else if (!DDD.equals(other.DDD))
			return false;
		if (country == null) {
			if (other.country != null)
				return false;
		} else if (!country.equals(other.country))
			return false;
		if (number == null) {
			if (other.number != null)
				return false;
		} else if (!number.equals(other.number))
			return false;
		return true;
	}
}
